cc.Class({
    extends: cc.Component,

   showWxAd:function(){
		
		if(cc.sys.platform === cc.sys.WECHAT_GAME){
			
			let self = this;
			
			wx.getSystemInfo({
				success (res) {
					self.bannerAd  = wx.createBannerAd({
						adUnitId: 'adunit-08d00992469b6754',
						adIntervals:'30',
						style: {
							left: (res.windowWidth-300)/2,
							top: 0,
							width: 300,
							height:100
						}
					})
					
					self.bannerAd.onError(err => {
						console.log(err)
					})
					
					
					self.bannerAd.show();
					
				}
			})
		
		}
	},
});
